import request from "@/utils/request";

/* 个人知识库 */
export function list_library(params) {
    return request({
        url: '/api/library/list_library',
        method: 'get',
        params
    })
}

/* 知识库详情 */
export function info_library(params) {
    return request({
        url: '/api/library/info_library',
        method: 'get',
        params
    })
}

/* 添加知识库 */
export function add_library(data) {
    return request({
        url: '/api/library/add_library',
        method: 'post',
        data
    })
}

/* 删除知识库 */
export function remove_library(data) {
    return request({
        url: '/api/library/remove_library',
        method: 'post',
        data
    })
}

/* 更新知识库 */
export function update_library(data) {
    return request({
        url: '/api/library/update_library',
        method: 'post',
        data
    })
}
/* 删除知识库文件 */
export function lib_file_delete(data) {
    return request({
        url: '/api/library/lib_file_delete',
        method: 'post',
        data
    })
}
/* 轮询状态 */
export function select_status(data) {
    return request({
        url: '/api/library/select_status',
        method: 'post',
        data
    })
}
// 生成分享链接
export function share_code(params) {
    return request({
        url: '/api/share_lib/share_code',
        method: 'get',
        params
    })
}
// 检查知识库是否可加入
export function check_added(params) {
    return request({
        url: '/api/share_lib/check_added',
        method: 'get',
        params
    })
}
// 加入知识库

export function add_lib(data) {
    return request({
        url: '/api/share_lib/add_lib',
        method: 'post',
        data
    })
}
// 退出知识库
export function leave_lib(data) {
    return request({
        url: '/api/share_lib/leave_lib',
        method: 'post',
        data
    })
}
// 获取用户列表
export function get_user_by_lib(params) {
    return request({
        url: '/api/share_lib/get_user_by_lib',
        method: 'get',
        params
    })
}
// 更新知识库成员的权限
export function update_permission(data) {
    return request({
        url: '/api/share_lib/update_permission',
        method: 'post',
        data
    })
}
// 转换为共享知识库
export function convert_share(data) {
    return request({
        url: '/api/share_lib/convert_share',
        method: 'post',
        data
    })
}
// 把共享知识库转换为个人知识库
export function convert_owner(data) {
    return request({
        url: '/api/share_lib/convert_owner',
        method: 'post',
        data
    })
}